package com.wan.personnel2.web.controller;


import com.wan.personnel2.entity.EmployeeInf;
import com.wan.personnel2.entity.ResultCode;
import com.wan.personnel2.service.EmployeeInfService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/employeeInf")
public class EmployeeInfController {

    @Autowired
    private EmployeeInfService service;

    @RequestMapping("/getAll")
    @ResponseBody
    public ResultCode<EmployeeInf> getEmpData(Integer page, Integer limit){
        ResultCode<EmployeeInf> rc = service.getEmpDate(page,limit);
        return rc;
    }

    @RequestMapping("/addEmp")
    @ResponseBody
    public boolean addEmpInf(@RequestBody EmployeeInf employee){
        boolean ans = service.addEmp(employee);
        return ans;

    }

}
